//
//  MyChannelTableViewCell.m
//  FNer
//
//  Created by 王展 on 15/10/5.
//  Copyright (c) 2015年 wangzhan. All rights reserved.
//

#import "MyChannelTableViewCell.h"
#import "UIImageView+WebCache.h"

@implementation MyChannelTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setMyChannelCell];
    }
    return self;
}

-(void)setMyChannelCell
{
    UIView *bigView = [[UIView alloc] initWithFrame:CGRectMake(10 * XWIDTH, 5 * XHIGHT, WIDTH - 20 * XWIDTH, 100 * XHIGHT)];
    bigView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:bigView];
    
    self.titleimageView = [[UIImageView alloc] initWithFrame:CGRectMake(10 * XWIDTH, 10 * XHIGHT, 80 * XHIGHT, 80 * XHIGHT)];
    self.titleimageView.backgroundColor = [UIColor whiteColor];
    [bigView addSubview:self.titleimageView];
    
    self.titleLable = [[UILabel alloc] initWithFrame:CGRectMake(120 * XWIDTH, 35 * XHIGHT, 200 * XWIDTH, 30 * XHIGHT)];
    self.titleLable.backgroundColor = [UIColor clearColor];
    self.titleLable.textColor = [UIColor grayColor];
    [bigView addSubview:self.titleLable];
}

-(void)setAchannel:(Channels *)achannel
{
    _achannel = achannel;
    self.titleLable.text = self.achannel.channelName;
    self.titleLable.font = [UIFont systemFontOfSize:17 * XWIDTH];
    
    [self.titleimageView sd_setImageWithURL:[NSURL URLWithString:self.achannel.channelIcon]];
}



@end
